package com.clover.framework.net;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by masl on 2018/11/26.
 */
public class HttpItem {
    //访问网址
    String URL;
    //设置Host的标头信息
    String host;
    //请求标头值 默认为text/html, application/xhtml+xml, */*
    String accept = "text/html, application/xhtml+xml, */*";
    //请求返回类型默认 text/html
    String contentType = "text/html";
    //客户端访问信息默认Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
    String userAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
    //Post数据
    Map<String, Object> params = new HashMap<>();
    // 来源地址，上次访问地址
    String referer = "";
    //Cookie
    String cookie = "";
    //encoding
    String encoding = "utf-8";
    //Content-Encoding
    String contentEncoding = "";
    //代理 ip
    String proxyIp;
    //代理 端口
    Integer proxyPort;
    //
    String connection = "Keep-Alive";
    //header参数
    Map<String, String> header;

    public String getHost() {
        return host;
    }

    public HttpItem setHost(String host) {
        this.host = host;
        return this;
    }

    public String getAccept() {
        return accept;
    }

    public HttpItem setAccept(String accept) {
        this.accept = accept;
        return this;
    }

    public String getContentType() {
        return contentType;
    }

    public HttpItem setContentType(String contentType) {
        this.contentType = contentType;
        return this;
    }

    public String getUserAgent() {
        return userAgent;
    }

    public HttpItem setUserAgent(String userAgent) {
        this.userAgent = userAgent;
        return this;
    }

    public Map<String, String> getHeader() {
        return header;
    }

    public HttpItem setHeader(Map<String, String> header) {
        this.header = header;
        return this;
    }

    public String getReferer() {
        return referer;
    }

    public HttpItem setReferer(String referer) {
        this.referer = referer;
        return this;
    }

    public String getCookie() {
        return cookie;
    }

    public HttpItem setCookie(String cookie) {
        this.cookie = cookie;
        return this;
    }

    public String getConnection() {
        return connection;
    }

    public HttpItem setConnection(String connection) {
        this.connection = connection;
        return this;
    }

    public String getURL() {
        return URL;
    }

    public HttpItem setURL(String uRL) {
        URL = uRL;
        return this;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public HttpItem setParams(Map<String, Object> params) {
        this.params = params;
        return this;
    }

    public String getEncoding() {
        return encoding;
    }

    public HttpItem setEncoding(String encoding) {
        this.encoding = encoding;
        return this;
    }

    public String getContentEncoding() {
        return contentEncoding;
    }

    public HttpItem setContentEncoding(String contentEncoding) {
        this.contentEncoding = contentEncoding;
        return this;
    }

    public String getProxyIp() {
        return proxyIp;
    }

    public HttpItem setProxyIp(String proxyIp) {
        this.proxyIp = proxyIp;
        return this;
    }

    public Integer getProxyPort() {
        return proxyPort;
    }

    public HttpItem setProxyPort(Integer proxyPort) {
        this.proxyPort = proxyPort;
        return this;
    }
}